package com.escool.model;

// Generated 01-08-2013 12:29:17 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * TbRecord generated by hbm2java
 */
@Entity
@Table(name = "tb_record")
public class TbRecord implements java.io.Serializable {

	private Integer idRecordExpediente;
	private String emisario;
	private String fecha;
	private TbTipoRecord tbTipoRecord;
	private String nombreRecord;
	private Set<TbExpedienteHasRecord> tbExpedienteHasRecords = new HashSet<TbExpedienteHasRecord>(
			0);
	
	private Integer idSeccionHasMateria;

	@Transient
	public Integer getIdSeccionHasMateria() {
		return idSeccionHasMateria;
	}

	public void setIdSeccionHasMateria(Integer idSeccionHasMateria) {
		this.idSeccionHasMateria = idSeccionHasMateria;
	}
	

	public TbRecord() {
	}

	public TbRecord(String emisario, String fecha, String nombreRecord,
			TbTipoRecord tbTipoRecord) {
		this.emisario = emisario;
		this.fecha = fecha;
		this.nombreRecord = nombreRecord;
		this.tbTipoRecord = tbTipoRecord;
	}
	public TbRecord(TbTipoRecord tbTipoRecord, String nombreRecord) {
		this.tbTipoRecord = tbTipoRecord;
		this.nombreRecord = nombreRecord;
	}

	public TbRecord(TbTipoRecord tbTipoRecord, String nombreRecord,
			Set<TbExpedienteHasRecord> tbExpedienteHasRecords) {
		this.tbTipoRecord = tbTipoRecord;
		this.nombreRecord = nombreRecord;
		this.tbExpedienteHasRecords = tbExpedienteHasRecords;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id_record_expediente", unique = true, nullable = false)
	public Integer getIdRecordExpediente() {
		return this.idRecordExpediente;
	}

	public void setIdRecordExpediente(Integer idRecordExpediente) {
		this.idRecordExpediente = idRecordExpediente;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "tb_tipo_record_id_tipo_record", nullable = false)
	public TbTipoRecord getTbTipoRecord() {
		return this.tbTipoRecord;
	}

	public void setTbTipoRecord(TbTipoRecord tbTipoRecord) {
		this.tbTipoRecord = tbTipoRecord;
	}
	
	@Column(name = "emisario", nullable = false, length = 128)
	public String getEmisario() {
		return this.emisario;
	}

	public void setEmisario(String emisario) {
		this.emisario = emisario;
	}

	@Column(name = "fecha", nullable = false, length = 64)
	public String getFecha() {
		return this.fecha;
	}

	public void setFecha(String fecha) {
		this.fecha = fecha;
	}

	@Column(name = "nombre_record", nullable = false, length = 255)
	public String getNombreRecord() {
		return this.nombreRecord;
	}

	public void setNombreRecord(String nombreRecord) {
		this.nombreRecord = nombreRecord;
	}

	@OneToMany(fetch = FetchType.EAGER, mappedBy = "tbRecord")
	public Set<TbExpedienteHasRecord> getTbExpedienteHasRecords() {
		return this.tbExpedienteHasRecords;
	}

	public void setTbExpedienteHasRecords(
			Set<TbExpedienteHasRecord> tbExpedienteHasRecords) {
		this.tbExpedienteHasRecords = tbExpedienteHasRecords;
	}

}
